package com.foo.web.controller.api;

import java.sql.SQLException;
import java.util.List;

import com.foo.common.enums.OperatorType;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import com.foo.common.annotation.Log;
import com.foo.common.enums.BusinessType;
import com.foo.wechat.domain.WxBanner;
import com.foo.wechat.service.IWxBannerService;
import com.foo.common.core.controller.BaseController;
import com.foo.common.core.domain.AjaxResult;

/**
 * 首页轮播Api
 *
 * @author foo
 * @date 2025-11-13
 */
@Controller
@RequestMapping("/wechat/api/WxBanner")
public class WxBannerApi extends BaseController
{
    @Autowired
    private IWxBannerService wxBannerService;

    /**
     * 查询首页轮播列表
     */
    @GetMapping("/list")
    @ResponseBody
    public AjaxResult list(WxBanner wxBanner,Integer pageNum, Integer pageSize)
    {
        if(pageNum != null){
            Integer size = 10;
            if(pageSize != null){
                size = pageSize;
            }
            PageHelper.startPage(pageNum, size);
        }
        List<WxBanner> list = wxBannerService.selectWxBannerList(wxBanner);
        return AjaxResult.success(list);
    }
}
